#ifndef PGR_H_
#define PGR_H_

#include "recbase.h"
#include "rectype.h"
#include "stdffield.h"
#include <string>
#include <vector>


namespace opsrc {
    namespace stdf {

        class Pgr : public opsrc::stdf::RecBase
        {
        public:
            Pgr(stdf_rec stdfrec,  int reclen, std::ios::pos_type fileRecFirstBytePosition, int orderindex, endian e, char* buf);
            virtual ~Pgr();

            const StdfField<int> getGroupIndex() const;
            void setGroupIndex(StdfField<int> grpindx);

            const StdfField<string> getGroupName() const;
            void setGroupName(StdfField<string> grpnam);

            const StdfField<int> getIndexCount() const;
            void setIndexCount(StdfField<int> indxcnt);

            const StdfField<vector<unsigned int> >  getPinIndexArray() const;
            void setPinIndexArray(StdfField<vector<unsigned int> > pmrindx);

            void readFields(char *buf);

        protected:
            Pgr();

        private:
            StdfField<int> grp_indx;
            StdfField<string> grp_nam;
            StdfField<int> indx_cnt;
            StdfField<vector<unsigned int> > pmr_indx;

            endian en;
            bool decodeFields;

            /*
GRP_INDX U*2 Unique index associated with pin group
GRP_NAM C*n Name of pin group length byte = 0
INDX_CNT U*2 Count (k) of PMR indexes
PMR_INDX kxU*2 Array of indexes for pins in the group INDX_CNT = 0
*/			
        };

    }	// namespace stdf
}		// namespace opsrc

#endif /*PGR_H_*/
